package com.church.services;

import java.util.List;

import com.church.dao.AnnouncementDao;
import com.church.db.Announcement;

public class AnnouncementServicesImpl implements AnnouncementServices,
		AnnouncementDao {
	private AnnouncementDao announcementDao;
	
	public AnnouncementDao getAnnouncementDao() {
		return announcementDao;
	}

	public void setAnnouncementDao(AnnouncementDao announcementDao) {
		this.announcementDao = announcementDao;
	}

	@Override
	public String remove(Announcement announcement) {
		return announcementDao.remove(announcement);
	}

	@Override
	public Announcement getAnnouncementById(long id) {
		return announcementDao.getAnnouncementById(id);
	}

	@Override
	public String add(Announcement announcement) {
		return announcementDao.add(announcement);
	}

	@Override
	public String update(Announcement announcement) {
		return announcementDao.update(announcement);
	}

	@Override
	public String delete(Announcement announcement) {
		announcement.setState("3");
		return announcementDao.update(announcement);
	}

	@Override
	public Announcement getAnnouncementById(int id) {
		return announcementDao.getAnnouncementById(id);
	}

	@Override
	public List<Announcement> getAnnouncementByGroup(String group) {
		return announcementDao.getAnnouncementByGroup(group);
	}

	@Override
	public List<Announcement> getList() {
		return announcementDao.getList();
	}

}
